package day5;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStreamReader;

public class TestReader {
	public static void main(String[] args) {
		//使用字符流  读取文件 
		FileReader reader = null ;
		FileWriter writer = null ;
		//字节流>字符流（包装流）
//	InputStreamReader reader = new	InputStreamReader(in);
//	BufferedReader br = new BufferedReader(in);
		try {
			reader = new FileReader("E:\\Briup\\workspace\\Test\\src\\day5\\TestFileInputStream.java");
			writer = new FileWriter("F:\\学习\\b.txt");
			char[] arr = new char[2048];
			//节点流 == 原始流
			//包装流（节点流、） 增强功能 一行一行读
			BufferedReader br = new BufferedReader(reader);
			 int len = -1;
		String line = null; 
				while ((line = br.readLine())!=null) {
					//每行输出了什么
					System.out.println(line);
					writer.write(line);
					writer.write("\n");
                       writer.flush();
				}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
